﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace Helpers.Extensions
{
    public static class RegexExt
    {

        public static bool IsMatch(this string @this, string pattern, RegexOptions options = RegexOptions.None)
        {
            return Regex.IsMatch(@this ?? string.Empty, pattern, options);
        }
        public static Match GetMatch(this string @this, string pattern, RegexOptions options = RegexOptions.None)
        {
            return Regex.Match(@this ?? string.Empty, pattern, options);
        }

        public static MatchCollection GetMatches(this string @this, string pattern, RegexOptions options = RegexOptions.None)
        {
            return Regex.Matches(@this ?? string.Empty, pattern, options);
        }
    }
}
